import React from 'react'
import { routeType } from '../type/index'
import { WapHomeO, UserO } from "@react-vant/icons";

const Layout=React.lazy(()=>import('../pages/layout'))
const Login=React.lazy(()=>import('../pages/login'))
const Home=React.lazy(()=>import('../pages/home'))
const User=React.lazy(()=>import('../pages/user'))

// 二级路由
export const routes:routeType[]=[
    {
        path:'/',
        element:<Home/>,
        meta:{
            lable:'首页',
            icon:<WapHomeO/>
        }
    },{
        path:'/user',
        element:<User/>,
        meta:{
            lable:'个人中心',
            icon:<UserO/>
        }
    }
]

// 一级路由
export const routesList:routeType[]=[
    {
        path:'/',
        element:<Layout/>,
        meta:{
            lable:'主页'
        },
        children: routes,
    },{
        path:'/login',
        element:<Login/>,
        meta:{
            lable:'登录'
        }
    }
]